package com.victor.bookretail.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.victor.bookretail.domain.UserInfoBo;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * The customer info
 */
@Data
@Accessors(chain = true)
@TableName(value = "user_info")
public class UserInfoPo {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String name;

    private String phone;

    private String type;

    private Integer point;

    public static UserInfoPo fromBo(UserInfoBo bo) {
        UserInfoPo po = new UserInfoPo();
        po.setId(bo.getId());
        po.setName(bo.getName());
        po.setPhone(bo.getPhone());
        po.setType(bo.getType());
        po.setPoint(bo.getPoint());
        return po;
    }

    public UserInfoBo toBo() {
        UserInfoBo bo = new UserInfoBo();
        bo.setId(this.id);
        bo.setName(this.name);
        bo.setPhone(this.phone);
        bo.setType(this.type);
        bo.setPoint(this.point);
        return bo;
    }
}
